import React, { PureComponent } from 'react';
import { WriterWrapper, WriterItem, WriterInfo } from '../style'
import { connect } from 'react-redux'
class Writer extends PureComponent {
  render() {
    const { list } = this.props
    return (
      <WriterWrapper>
        {list.map((item) => {
          return (
            <WriterItem key={item.get('id')}>
              <img className="pic" alt="" src={item.get('imgUrl')} />
              <WriterInfo>
                <h4 className="name">{item.get('name')}</h4>
                <p className="desc">{item.get('desc')}</p>
              </WriterInfo>
            </WriterItem>
          )
        })}
      </WriterWrapper>
    )
  }
}
const mapState = (state) => ({
  list: state.getIn(['home', 'WriterList'])
})
export default connect(mapState, null)(Writer);